");return c.inlineElement=f,f}return b.updateStatus("ready"),b._parseMarkup(d,{},c),d}}});var H,I="ajax",J=function(){H&&a(document.body).removeClass(H)},K=function(){J(),b.req&&b.req.abort()};a.magnificPopup.registerModule(I,{options:{settings:null,cursor:"mfp-ajax-cur",tError:'
The content could not be loaded.'},proto:{initAjax:function(){b.types.push(I),H=b.st.ajax.cursor,w(h+"."+I,K),w("BeforeChange."+I,K)},getAjax:function(c){H&&a(document.body).addClass(H),b.updateStatus("loading");var d=a.extend({url:c.src,success:function(d,e,f){var g={data:d,xhr:f};y("ParseAjax",g),b.appendContent(a(g.data),I),c.finished=!0,J(),b._setFocus(),setTimeout(function(){b.wrap.addClass(q)},16),b.updateStatus("ready"),y("AjaxContentAdded")},error:function(){J(),c.finished=c.loadError=!0,b.updateStatus("error",b.st.ajax.tError.replace("%url%",c.src))}},b.st.ajax.settings);return b.req=a.ajax(d),""}}});var L,M=function(c){if(c.data&&void 0!==c.data.title)return c.data.title;var d=b.st.image.titleSrc;if(d){if(a.isFunction(d))return d.call(b,c);if(c.el)return c.el.attr(d)||""}return""};a.magnificPopup.registerModule("image",{options:{markup:'
',cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:!0,tError:'
The image could not be loaded.'},proto:{initImage:function(){var c=b.st.image,d=".image";b.types.push("image"),w(m+d,function(){"image"===b.currItem.type&&c.cursor&&a(document.body).addClass(c.cursor)}),w(h+d,function(){c.cursor&&a(document.body).removeClass(c.cursor),v.off("resize"+p)}),w("Resize"+d,b.resizeImage),b.isLowIE&&w("AfterChange",b.resizeImage)},resizeImage:function(){var a=b.currItem;if(a&&a.img&&b.st.image.verticalFit){var c=0;b.isLowIE&&(c=parseInt(a.img.css("padding-top"),10)+parseInt(a.img.css("padding-bottom"),10)),a.img.css("max-height",b.wH-c)}},_onImageHasSize:function(a){a.img&&(a.hasSize=!0,L&&clearInterval(L),a.isCheckingImgSize=!1,y("ImageHasSize",a),a.imgHidden&&(b.content&&b.content.removeClass("mfp-loading"),a.imgHidden=!1))},findImageSize:function(a){var c=0,d=a.img[0],e=function(f){L&&clearInterval(L),L=setInterval(function(){return d.naturalWidth>0?void b._onImageHasSize(a):(c>200&&clearInterval(L),c++,void(3===c?e(10):40===c?e(50):100===c&&e(500)))},f)};e(1)},getImage:function(c,d){var e=0,f=function(){c&&(c.img[0].complete?(c.img.off(".mfploader"),c===b.currItem&&(b._onImageHasSize(c),b.updateStatus("ready")),c.hasSize=!0,c.loaded=!0,y("ImageLoadComplete")):(e++,200>e?setTimeout(f,100):g()))},g=function(){c&&(c.img.off(".mfploader"),c===b.currItem&&(b._onImageHasSize(c),b.updateStatus("error",h.tError.replace("%url%",c.src))),c.hasSize=!0,c.loaded=!0,c.loadError=!0)},h=b.st.image,i=d.find(".mfp-img");if(i.length){var j=document.createElement("img");j.className="mfp-img",c.el&&c.el.find("img").length&&(j.alt=c.el.find("img").attr("alt")),c.img=a(j).on("load.mfploader",f).on("error.mfploader",g),j.src=c.src,i.is("img")&&(c.img=c.img.clone()),j=c.img[0],j.naturalWidth>0?c.hasSize=!0:j.width||(c.hasSize=!1)}return b._parseMarkup(d,{title:M(c),img_replaceWith:c.img},c),b.resizeImage(),c.hasSize?(L&&clearInterval(L),c.loadError?(d.addClass("mfp-loading"),b.updateStatus("error",h.tError.replace("%url%",c.src))):(d.removeClass("mfp-loading"),b.updateStatus("ready")),d):(b.updateStatus("loading"),c.loading=!0,c.hasSize||(c.imgHidden=!0,d.addClass("mfp-loading"),b.findImageSize(c)),d)}}});var N,O=function(){return void 0===N&&(N=void 0!==document.createElement("p").style.MozTransform),N};a.magnificPopup.registerModule("zoom",{options:{enabled:!1,easing:"ease-in-out",duration:300,opener:function(a){return a.is("img")?a:a.find("img")}},proto:{initZoom:function(){var a,c=b.st.zoom,d=".zoom";if(c.enabled&&b.supportsTransition){var e,f,g=c.duration,j=function(a){var b=a.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),d="all "+c.duration/1e3+"s "+c.easing,e={position:"fixed",zIndex:9999,left:0,top:0,"-webkit-backface-visibility":"hidden"},f="transition";return e["-webkit-"+f]=e["-moz-"+f]=e["-o-"+f]=e[f]=d,b.css(e),b},k=function(){b.content.css("visibility","visible")};w("BuildControls"+d,function(){if(b._allowZoom()){if(clearTimeout(e),b.content.css("visibility","hidden"),a=b._getItemToZoom(),!a)return void k();f=j(a),f.css(b._getOffset()),b.wrap.append(f),e=setTimeout(function(){f.css(b._getOffset(!0)),e=setTimeout(function(){k(),setTimeout(function(){f.remove(),a=f=null,y("ZoomAnimationEnded")},16)},g)},16)}}),w(i+d,function(){if(b._allowZoom()){if(clearTimeout(e),b.st.removalDelay=g,!a){if(a=b._getItemToZoom(),!a)return;f=j(a)}f.css(b._getOffset(!0)),b.wrap.append(f),b.content.css("visibility","hidden"),setTimeout(function(){f.css(b._getOffset())},16)}}),w(h+d,function(){b._allowZoom()&&(k(),f&&f.remove(),a=null)})}},_allowZoom:function(){return"image"===b.currItem.type},_getItemToZoom:function(){return b.currItem.hasSize?b.currItem.img:!1},_getOffset:function(c){var d;d=c?b.currItem.img:b.st.zoom.opener(b.currItem.el||b.currItem);var e=d.offset(),f=parseInt(d.css("padding-top"),10),g=parseInt(d.css("padding-bottom"),10);e.top-=a(window).scrollTop()-f;var h={width:d.width(),height:(u?d.innerHeight():d[0].offsetHeight)-g-f};return O()?h["-moz-transform"]=h.transform="translate("+e.left+"px,"+e.top+"px)":(h.left=e.left,h.top=e.top),h}}});var P="iframe",Q="//about:blank",R=function(a){if(b.currTemplate[P]){var c=b.currTemplate[P].find("iframe");c.length&&(a||(c[0].src=Q),b.isIE8&&c.css("display",a?"block":"none"))}};a.magnificPopup.registerModule(P,{options:{markup:'
',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",src:"//www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){b.types.push(P),w("BeforeChange",function(a,b,c){b!==c&&(b===P?R():c===P&&R(!0))}),w(h+"."+P,function(){R()})},getIframe:function(c,d){var e=c.src,f=b.st.iframe;a.each(f.patterns,function(){return e.indexOf(this.index)>-1?(this.id&&(e="string"==typeof this.id?e.substr(e.lastIndexOf(this.id)+this.id.length,e.length):this.id.call(this,e)),e=this.src.replace("%id%",e),!1):void 0});var g={};return f.srcAction&&(g[f.srcAction]=e),b._parseMarkup(d,g,c),b.updateStatus("ready"),d}}});var S=function(a){var c=b.items.length;return a>c-1?a-c:0>a?c+a:a},T=function(a,b,c){return a.replace(/%curr%/gi,b+1).replace(/%total%/gi,c)};a.magnificPopup.registerModule("gallery",{options:{enabled:!1,arrowMarkup:'
',preload:[0,2],navigateByImgClick:!0,arrows:!0,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%"},proto:{initGallery:function(){var c=b.st.gallery,e=".mfp-gallery";return b.direction=!0,c&&c.enabled?(f+=" mfp-gallery",w(m+e,function(){c.navigateByImgClick&&b.wrap.on("click"+e,".mfp-img",function(){return b.items.length>1?(b.next(),!1):void 0}),d.on("keydown"+e,function(a){37===a.keyCode?b.prev():39===a.keyCode&&b.next()})}),w("UpdateStatus"+e,function(a,c){c.text&&(c.text=T(c.text,b.currItem.index,b.items.length))}),w(l+e,function(a,d,e,f){var g=b.items.length;e.counter=g>1?T(c.tCounter,f.index,g):""}),w("BuildControls"+e,function(){if(b.items.length>1&&c.arrows&&!b.arrowLeft){var d=c.arrowMarkup,e=b.arrowLeft=a(d.replace(/%title%/gi,c.tPrev).replace(/%dir%/gi,"left")).addClass(s),f=b.arrowRight=a(d.replace(/%title%/gi,c.tNext).replace(/%dir%/gi,"right")).addClass(s);e.click(function(){b.prev()}),f.click(function(){b.next()}),b.container.append(e.add(f))}}),w(n+e,function(){b._preloadTimeout&&clearTimeout(b._preloadTimeout),b._preloadTimeout=setTimeout(function(){b.preloadNearbyImages(),b._preloadTimeout=null},16)}),void w(h+e,function(){d.off(e),b.wrap.off("click"+e),b.arrowRight=b.arrowLeft=null})):!1},next:function(){b.direction=!0,b.index=S(b.index+1),b.updateItemHTML()},prev:function(){b.direction=!1,b.index=S(b.index-1),b.updateItemHTML()},goTo:function(a){b.direction=a>=b.index,b.index=a,b.updateItemHTML()},preloadNearbyImages:function(){var a,c=b.st.gallery.preload,d=Math.min(c[0],b.items.length),e=Math.min(c[1],b.items.length);for(a=1;a<=(b.direction?e:d);a++)b._preloadItem(b.index+a);for(a=1;a<=(b.direction?d:e);a++)b._preloadItem(b.index-a)},_preloadItem:function(c){if(c=S(c),!b.items[c].preloaded){var d=b.items[c];d.parsed||(d=b.parseEl(c)),y("LazyLoad",d),"image"===d.type&&(d.img=a('
').on("load.mfploader",function(){d.hasSize=!0}).on("error.mfploader",function(){d.hasSize=!0,d.loadError=!0,y("LazyLoadError",d)}).attr("src",d.src)),d.preloaded=!0}}}});var U="retina";a.magnificPopup.registerModule(U,{options:{replaceSrc:function(a){return a.src.replace(/\.\w+$/,function(a){return"@2x"+a})},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var a=b.st.retina,c=a.ratio;c=isNaN(c)?c():c,c>1&&(w("ImageHasSize."+U,function(a,b){b.img.css({"max-width":b.img[0].naturalWidth/c,width:"100%"})}),w("ElementParse."+U,function(b,d){d.src=a.replaceSrc(d,c)}))}}}}),A()});
(function($){
"use strict";
CherryJsCore.utilites.namespace('cherryProjectsFrontSingleScripts');
CherryJsCore.cherryProjectsFrontSingleScripts={
init: function (){
var self=this;
if(CherryJsCore.status.is_ready){
self.readyRender(self);
}else{
CherryJsCore.variable.$document.on('ready', self.readyRender(self));
}},
readyRender: function(self){
self.skillsListInit(self);
self.imagesListingInit(self);
self.sliderInit(self);
},
skillsListInit: function(self){
$('.cherry-projects-single-skills-list li ').each(function(){
var $this=$(this),
skillValue=$('.skill-bar', $this).data('skill-value');
$('.skill-bar span', $this).css({
'width': skillValue + '%'
});
});
},
imagesListingInit: function(self){
$('.cherry-projects-additional-image-list').magnificPopup({
delegate: 'a',
type: 'image',
gallery: {
enabled: true
}});
$('.featured-image').magnificPopup({
delegate: 'a',
type: 'image',
mainClass: 'mfp-with-zoom',
zoom: {
enabled: true,
duration: 300,
easing: 'ease-in-out',
opener: function(openerElement){
return openerElement.is('img') ? openerElement:openerElement.find('img');
}}
});
$('.cherry-projects-additional-image-list').magnificPopup({
delegate: 'a',
type: 'image',
gallery: {
enabled: true
},
mainClass: 'mfp-with-zoom',
zoom: {
enabled: true,
duration: 300,
easing: 'ease-in-out',
opener: function(openerElement){
return openerElement.is('img') ? openerElement:openerElement.find('img');
}}
});
$('.cherry-projects-additional-image-list').each(function(){
var $this=$(this),
$thisList=$('.additional-image-list', $this),
$listItems=$('.image-item', $thisList),
listingLayout=$thisList.data('listing-layout'),
columnNumber=$thisList.data('column-number'),
imageMargin=$thisList.data('image-margin');
switch(listingLayout){
case 'grid-layout':
var itemWidth=(100 / +columnNumber).toFixed(3);
$listItems.css({
'-webkit-flex-basis': itemWidth + '%',
'flex-basis': itemWidth + '%',
});
$('.inner-wrapper', $listItems).css({
'margin': Math.floor(imageMargin / 2) + 'px',
});
$thisList.css({
'margin': - Math.floor(imageMargin / 2) + 'px',
});
break;
case 'masonry-layout':
$thisList.css({
'-webkit-column-count': +columnNumber,
'column-count': +columnNumber,
'-webkit-column-gap': +imageMargin,
'column-gap': +imageMargin,
});
$('.inner-wrapper', $listItems).css({
'margin-bottom': imageMargin + 'px',
});
break;
}});
},
sliderInit: function(self){
$('.cherry-projects-slider__instance').each(function(){
var slider=$(this),
settings=slider.data('settings'),
sliderId=settings['id'];
if($('.projects-slider__item', '#' + sliderId).length > 0){
$('#' + sliderId).sliderPro({
width: settings['width'],
height: settings['height'],
orientation: 'horizontal',
imageScaleMode: settings['scale-mode'],
forceSize: settings['force-size'],
aspectRatio: -1,
visibleSize: settings['visible-size'],
slideDistance: +settings['distance'],
slideAnimationDuration: +settings['duration'],
fade: false,
arrows: settings['navigation'],
fadeArrows: true,
buttons: false,
autoplay: settings['autoplay'],
fullScreen: true,
shuffle: false,
loop: settings['loop'],
waitForLayers: false,
thumbnailArrows: false,
thumbnailsPosition: settings['thumbnails-position'],
thumbnailWidth: settings['thumbnails-width'],
thumbnailHeight: settings['thumbnails-height'],
init: function(){
$(this).resize();
},
breakpoints: {
992: {
height: +settings['height'] * 0.75,
},
768: {
height: +settings['height'] * 0.5
}}
});
}});
}}
CherryJsCore.cherryProjectsFrontSingleScripts.init();
}(jQuery));
!function(t,i){"use strict";i.utilites.namespace("post_formats"),i.post_formats={init:function(){var t=this;i.status.document_ready?t.render(t):i.variable.$document.on("ready",t.render(t))},render:function(t){t.initalize("slider"),t.initalize("popup")},initalize:function(i){t(window).load(function(){t("*[data-cherry"+i+'="1"]').each(function(){var n=t(this).data(i),e=t(this).data("init");return t(this).data("initalized",!1),t(this).trigger({type:"cherry-post-formats-custom-init",item:t(this),object:i}),!0===t(this).data("initalized")?1:n?t.isFunction(jQuery.fn[n])?(t(this)[n](e),void 0):!1:!1})})}},i.post_formats.init()}(jQuery,window.CherryJsCore);
(function($){
'use strict';
var $event=$.event,
$special,
resizeTimeout;
$special=$event.special.debouncedresize={
setup: function(){
$(this).on('resize', $special.handler);
},
teardown: function(){
$(this).off('resize', $special.handler);
},
handler: function(event, execAsap){
var context=this,
args=arguments,
dispatch=function(){
event.type='debouncedresize';
$event.dispatch.apply(context, args);
};
if(resizeTimeout){
clearTimeout(resizeTimeout);
}
if(execAsap){
dispatch();
}else{
resizeTimeout=setTimeout(dispatch, $special.threshold);
}},
threshold: 150
};
$.fn.megaMenu=function(options){
var menu=$(this),
durationTimeout,
triggerFullscreen=1200,
triggerDesktop=970,
triggerTablet=menu.data('mobile-trigger'),
subClass='.tm-mega-menu-sub',
mobileOnClass='mega-menu-mobile-on',
mobileTriggerClass='.tm-mega-menu-mobile-trigger',
parentMegaClass='.tm-mega-menu-has-children',
inTransitionClass='tm-in-transition',
forceHideClass='tm-force-hide',
hoverClass='tm-mega-menu-hover',
clickGoClass='mega-click-click-go',
noJsClass='tm-mega-no-js',
megaToggleOnClass='mega-toggle-on',
hideMobileClass='item-hide-mobile',
isTouchDevice='ontouchstart' in window||0 < navigator.maxTouchPoints||0 < navigator.msMaxTouchPoints||window.innerWidth <=triggerTablet,
isMobile;
menu.settings=$.extend({
effect: menu.data('effect'),
parent: menu.data('parent-selector'),
direction: menu.data('direction'),
duration: menu.data('duration'),
mobileButton: menu.data('mobile-button')
}, options);
var isInMegamenu=function(el){
return !!el.parents('li.item-type-megamenu').length;
};
var switchMobile=function(){
if(window.innerWidth <=triggerTablet){
mobileOn();
}else{
mobileOff();
}};
var mobileOn=function(){
detachStyles();
if(isMobile){
return;
}
menu
.addClass(mobileOnClass)
.siblings(mobileTriggerClass)
.addClass(mobileOnClass);
isMobile=true;
};
var mobileOff=function(){
appendStyles();
if(!isMobile&&undefined!==isMobile){
return;
}
menu
.removeClass(mobileOnClass)
.siblings(mobileTriggerClass)
.removeClass(mobileOnClass);
isMobile=false;
};
var getMenuWidth=function(string_width){
var width=0;
if(0 <=string_width.indexOf('%')){
width=($(menu.settings.parent).width() * parseInt(string_width)) / 100;
}
if(0 <=string_width.indexOf('px')){
width=parseInt(string_width);
}
return width;
};
var detachStyles=function(){
$('li' + parentMegaClass, menu).each(function(){
$(this).children('a').removeAttr('style');
});
};
var appendStyles=function(){
$('li' + parentMegaClass, menu).each(function(){
var item=$(this),
anchor=$(this).children('a'),
menuWidth=null,
type=item.data('sub-type'),
windowWidth=Math.min($(document).width(), window.innerWidth),
position=item.data('sub-position'),
styles={},
parent=menu.settings.parent,
width,
left,
right,
top;
if('standard'!==type){
menuWidth='100%';
}
if('fullwidth'!=position){
if(windowWidth >=triggerFullscreen){
menuWidth=item.data('width-fullscreen');
}else if(windowWidth >=triggerDesktop&&windowWidth < triggerFullscreen){
menuWidth=item.data('width-desktop');
}else if(windowWidth < triggerDesktop){
menuWidth=item.data('width-tablet');
}}
if('megamenu'===type){
switch(position){
case 'fullwidth' :
menuWidth=getMenuWidth(menuWidth);
styles.left=$(parent).offset().left - menu.offset().left + parseInt($(parent).css('padding-left')) + parseInt($(parent).css('border-left-width'));
break;
case 'left-parent' :
left=item.offset().left - $(parent).offset().left;
styles.left=left;
styles.right='auto';
if('100%'==menuWidth&&0 < left){
menuWidth='auto';
styles.right=0;
}
break;
}}
if(null!==menuWidth){
styles.width=menuWidth;
}
anchor
.siblings(subClass)
.css(styles);
});
};
var hidePanel=function(anchor){
if(isMobile){
return;
}
anchor
.parent()
.addClass(inTransitionClass)
.removeClass(hoverClass)
.triggerHandler('closePanel');
clearTimeout(durationTimeout);
durationTimeout=setTimeout(
function(){
anchor.closest('.menu-item').removeClass(inTransitionClass);
},
menu.settings.duration
);
};
var showPanel=function(anchor){
anchor
.parent()
.removeClass(inTransitionClass)
.addClass(hoverClass)
.triggerHandler('openPanel');
anchor
.parent()
.siblings()
.removeClass(inTransitionClass);
};
var openOnClick=function(){
var parents='li' + parentMegaClass,
target='a',
items=parents + ' > ' + target + ', ' + parents + ' > .menu-link-wrapper > ' + target + ', li.super-guacamole__menu' + ' > ' + target;
$(document).on('click.megaMenu', items, panelTriggerOnClick);
};
var closeAllPanels=function(event){
if(! $(event.target).closest('.tm-mega-menu li').length){
hidePanel($('.' + hoverClass).children('a'));
}};
var panelTriggerOnClick=function(event){
var $this=$(event.target),
parent=$this.closest('li'),
anchor=$('> a', parent);
if($this.hasClass('mega-menu-arrow')||$this.hasClass('sub-menu-toggle')){
event.stopPropagation();
event.preventDefault();
if(parent.hasClass(hideMobileClass)&&menu.hasClass(mobileOnClass)){
return;
}
hidePanel(parent.siblings('.' + hoverClass).children('a'));
showPanel(anchor);
}};
var openOnHover=function(){
if(isMobile){
return;
}
$('li' + parentMegaClass, menu).on('hover', panelTriggerOnHover);
};
var panelTriggerOnHover=function(event){
var item=$(event.currentTarget),
anchor=item.children('a');
if(isInMegamenu(item)){
return;
}
if('mouseenter'==event.type){
showPanel(anchor);
}
if('mouseleave'==event.type){
hidePanel(anchor);
}};
var mobileToggle=function(){
if(menu.settings.mobileButton){
var checkbox=$('.tm-mega-menu-mobile-trigger-box');
$(menu.settings.mobileButton).click(function(){
checkbox.prop('checked', ! checkbox.prop('checked'));
});
}};
var init=function(){
menu.removeClass(noJsClass);
$(window).on('debouncedresize', function(event){
switchMobile();
if(isTouchDevice){
openOnClick();
$(document).on('click', 'body', closeAllPanels);
}else{
openOnHover();
}}).trigger('debouncedresize');
mobileToggle();
};
init();
};
$('.tm-mega-menu').megaMenu();
})(jQuery);
(function($, CherryJsCore){
var methods={
init: function(options){
var settings={
call: function(){}};
return this.each(function(){
var $this=$(this),
$window=$(window),
popupSettings=$this.data('popup-settings'),
popupsLocalStorageData=getLocalStorageData()||{},
popupAvailable=popupsLocalStorageData[ popupSettings.id ]||'enable',
$showAgainCheck=$('.cherry-popup-show-again-check', $this),
$subscribeForm=$('.cherry-popup-subscribe', $this),
cherrySubscribeFormAjax=null,
subscribeFormAjaxId='cherry_subscribe_form_ajax',
$subscribeFormMessage=null,
$loginForm=$('.cherry-popup-login', $this),
cherryLoginFormAjax=null,
loginFormAjaxId='cherry_login_form_ajax',
$loginFormMessage=null,
$registerForm=$('.cherry-popup-register', $this),
cherryRegisterFormAjax=null;
registerFormAjaxId='cherry_register_form_ajax',
$registerFormMessage=null;
if(options){
$.extend(settings, options);
}
(function(){
if('disable'===popupAvailable){
$this.remove();
return false;
}
if(! popupsLocalStorageData.hasOwnProperty(popupSettings.id)){
popupsLocalStorageData[ popupSettings.id ]='enable';
}
setLocalStorageData(popupsLocalStorageData);
switch(popupSettings.use){
case 'open-page':
addOpenEventsFunction();
break;
case 'close-page':
addCloseEventsFunction();
break;
}
customEventsFunction();
if('false'===popupSettings['show-once']){
checkEvents();
}else{
$showAgainCheck.remove();
popupsLocalStorageData[ popupSettings.id ]='disable';
setLocalStorageData(popupsLocalStorageData);
}
closePopupEvent();
if($subscribeForm[0]){
subscribeFormInit();
}
if($loginForm[0]){
loginFormInit();
}
if($registerForm[0]){
registerFormInit();
}})();
function addOpenEventsFunction(){
switch(popupSettings['open-appear-event']){
case 'page-load':
pageLoadEvent(popupSettings['load-open-delay']);
break;
case 'user-inactive':
userInactiveEvent(popupSettings['inactive-time']);
break;
case 'scroll-page':
scrollPageEvent(popupSettings['page-scrolling-value']);
break;
}}
function addCloseEventsFunction(){
switch(popupSettings['close-appear-event']){
case 'outside-viewport':
viewportLeaveEvent();
break;
case 'page-focusout':
pageFocusoutEvent();
break;
}}
function customEventsFunction(){
var eventType=popupSettings['custom-event-type'],
selector=popupSettings['popup-selector'];
if(''===selector){
return false;
}
switch(eventType){
case 'click':
$(document).on('click', selector, function(event){
event.preventDefault();
showPopup();
})
break;
case 'hover':
$(document).on('mouseenter', selector, function(event){
showPopup();
})
break;
}}
function closePopupEvent(){
var timeout=null;
$this.on('click', '.cherry-popup-close-button', function(event){
var button=event.currentTarget;
$this.toggleClass('hide-animation show-animation');
clearTimeout(timeout);
timeout=setTimeout(function(){
hidePopup();
}, 300);
});
$this.on('click', '.cherry-popup-overlay', function(event){
var overlay=event.currentTarget;
$this.toggleClass('hide-animation show-animation');
clearTimeout(timeout);
timeout=setTimeout(function(){
hidePopup();
}, 300);
});
$this.on('click', '.cherry-popup-close-label', function(event){
var overlay=event.currentTarget;
$this.toggleClass('hide-animation show-animation');
clearTimeout(timeout);
timeout=setTimeout(function(){
hidePopup();
}, 300);
});
$(document).on('keyup', function(event){
if(! $this.hasClass('show-animation')){
return false;
}
if(27==event.keyCode&&$this.hasClass('show-animation')){
$this.toggleClass('hide-animation show-animation');
clearTimeout(timeout);
timeout=setTimeout(function(){
hidePopup();
}, 300);
}});
}
function checkEvents(){
$this.on('click', '.cherry-popup-show-again-check', function(event){
var check=event.currentTarget,
popupsLocalStorageData=getLocalStorageData()||{};
if(! $(check).hasClass('checked')){
$(check).addClass('checked');
popupsLocalStorageData[ popupSettings.id ]='disable';
}else{
$(check).removeClass('checked');
popupsLocalStorageData[ popupSettings.id ]='enable';
}
setLocalStorageData(popupsLocalStorageData);
});
}
function showPopup(){
var $popupList=$('.cherry-popup');
$popupList.each(function(){
var $popup=$(this),
timeout=null;
if($popup.hasClass('show-animation')){
$popup.toggleClass('hide-animation show-animation');
clearTimeout(timeout);
timeout=setTimeout(function(){
$popup.toggleClass('waiting-status hide-animation');
}, 300);
}});
$this.removeClass('waiting-status');
$this.addClass('show-animation');
if($('.cherry-popup-login__input-user', $loginForm)[0]){
$('.cherry-popup-login__input-user', $loginForm).focus();
}
if($('.cherry-popup-register__input-login', $registerForm)[0]){
$('.cherry-popup-register__input-login', $registerForm).focus();
}}
function hidePopup(){
$this.toggleClass('waiting-status hide-animation');
}
function pageLoadEvent(openDelay){
var delay=+openDelay||0;
delay=delay * 1000;
$(document).on('ready', function(){
setTimeout(function(){
showPopup();
}, delay);
});
}
function userInactiveEvent(inactiveDelay){
var delay=+inactiveDelay||0,
isInactive=true;
delay=delay * 1000;
setTimeout(function(){
if(isInactive){
showPopup();
}}, delay);
$(document).on('click focus resize keyup scroll', function(){
isInactive=false;
});
}
function scrollPageEvent(scrollingValue){
var scrolledValue=+scrollingValue||0;
$(window).on('scroll.cherryPopupScrollEvent resize.cherryPopupResizeEvent', function(){
var $window=$(window),
windowHeight=$window.height(),
documentHeight=$(document).height(),
scrolledHeight=documentHeight - windowHeight,
scrolledProgress=Math.max(0, Math.min(1, $window.scrollTop() / scrolledHeight)) * 100;
if(scrolledProgress >=scrolledValue){
$(window).off('scroll.cherryPopupScrollEvent resize.cherryPopupResizeEvent');
showPopup();
}}).trigger('scroll.cherryPopupScrollEvent');
}
function viewportLeaveEvent(){
var pageY=0;
$(document).on('mouseleave', 'body', function(event){
if(! $('.open-page-type')[0]){
pageY=event.pageY - $window.scrollTop();
if(0 > pageY){
showPopup();
}}
});
}
function pageFocusoutEvent(){
$(window).on('blur', function(){
if(! $('.open-page-type')[0]){
showPopup();
}});
}
function subscribeFormInit(){
$subscribeFormMessage=$('.cherry-popup-subscribe__message', $subscribeForm);
cherrySubscribeFormAjax=new CherryJsCore.CherryAjaxHandler({
handlerId: subscribeFormAjaxId,
successCallback: subscribeFormAjaxSuccessCallback
}
);
$subscribeForm.on('click', '.cherry-popup-subscribe__submit', subscribeFormAjax);
}
function subscribeFormAjax(){
var $input=$('.cherry-popup-subscribe__input', $subscribeForm),
inputValue=$input.val();
cherrySubscribeFormAjax.sendData({ 'mail': inputValue });
}
function subscribeFormAjaxSuccessCallback(data){
var successType=data.type,
message=data.message||'',
timeout=null;
if('success'===successType){
$subscribeFormMessage.addClass('success-type');
}
$('span', $subscribeFormMessage).html(message);
$subscribeFormMessage.slideDown(300);
timeout=setTimeout(function(){
$subscribeFormMessage.slideUp(300, function(){
$subscribeFormMessage.removeClass('success-type');
clearTimeout(timeout);
});
}, 6000);
}
function loginFormInit(){
$loginFormMessage=$('.cherry-popup-login__message', $loginForm);
cherryLoginFormAjax=new CherryJsCore.CherryAjaxHandler({
handlerId: loginFormAjaxId,
successCallback: loginFormAjaxSuccessCallback
}
);
$loginForm.on('click', '.cherry-popup-login__login-in', loginFormAjax);
$loginForm.on('keyup', '.cherry-popup-login__input-user, .cherry-popup-login__input-pass', function(event){
if(13==(event.keyCode ? event.keyCode:event.which)){
loginFormAjax();
}});
$loginForm.on('click', '.cherry-popup-login__remember', function(){
$(this).toggleClass('checked');
});
}
function loginFormAjax(){
var user=$('.cherry-popup-login__input-user', $loginForm).val(),
pass=$('.cherry-popup-login__input-pass', $loginForm).val(),
$remember=$('.cherry-popup-login__remember', $loginForm),
data={
'user': user,
'pass': pass,
'remember': $remember.hasClass('checked') ? 'true':'false'
};
$('.cherry-popup-spinner', $loginForm).css({ 'display':'block'});
cherryLoginFormAjax.sendData(data);
}
function loginFormAjaxSuccessCallback(data){
var successType=data.type,
message=data.message||'',
timeout=null;
$('.cherry-popup-spinner', $loginForm).css({ 'display':'none'});
if('success'===successType){
$loginFormMessage.addClass('success-type');
window.location.reload();
}
$('span', $loginFormMessage).html(message);
$loginFormMessage.slideDown(300);
/*timeout=setTimeout(function(){
$loginFormMessage.slideUp(300, function(){
$loginFormMessage.removeClass('success-type');
clearTimeout(timeout);
});
}, 6000);*/
}
function registerFormInit(){
$registerFormMessage=$('.cherry-popup-register__message', $registerForm);
cherryRegisterFormAjax=new CherryJsCore.CherryAjaxHandler({
handlerId: registerFormAjaxId,
successCallback: registerFormAjaxSuccessCallback
});
$registerForm.on('click', '.cherry-popup-register__sign-up', registerFormAjax);
$registerForm.on('keyup', '.cherry-popup-register__input-login, .cherry-popup-login__input-mail', function(event){
if(13==(event.keyCode ? event.keyCode:event.which)){
registerFormAjax();
}});
}
function registerFormAjax(){
var login=$('.cherry-popup-register__input-login', $registerForm).val(),
mail=$('.cherry-popup-login__input-mail', $registerForm).val(),
data={
'login': login,
'mail': mail
};
$('.cherry-popup-spinner', $registerForm).css({ 'display':'block' });
cherryRegisterFormAjax.sendData(data);
}
function registerFormAjaxSuccessCallback(data){
var $registerFormMessage=$('.cherry-popup-register__message', $registerForm),
successType=data.type,
message=data.message||'',
timeout=null;
$('.cherry-popup-spinner', $registerForm).css({ 'display':'none' });
if('success'===successType){
$registerFormMessage.addClass('success-type');
}
$('span', $registerFormMessage).html(message);
$registerFormMessage.slideDown(300);
/*timeout=setTimeout(function(){
$registerFormMessage.slideUp(300, function(){
$registerFormMessage.removeClass('success-type');
clearTimeout(timeout);
});
}, 6000);*/
}
function getLocalStorageData(){
try {
return JSON.parse(localStorage.getItem('popupsLocalStorageData'));
} catch(e){
return false;
}}
function setLocalStorageData(object){
try {
localStorage.setItem('popupsLocalStorageData', JSON.stringify(object));
} catch(e){
return false;
}}
});
},
destroy: function(){},
update: function(){}};
$.fn.cherryPopupsPlugin=function(method){
if(methods[method]){
return methods[ method ].apply(this, Array.prototype.slice.call(arguments, 1));
}else if('object'===typeof method||! method){
return methods.init.apply(this, arguments);
}else{
$.error('Method with name ' + method + ' is not exist for jQuery.cherryPopupsPlugin');
}};})(jQuery, window.CherryJsCore);
(function($, CherryJsCore){
'use strict';
CherryJsCore.utilites.namespace('cherryPopupsFrontScripts');
CherryJsCore.cherryPopupsFrontScripts={
init: function(){
if($('.cherry-popup-wrapper')[0]){
$('.cherry-popup-wrapper').cherryPopupsPlugin();
}}
};
CherryJsCore.cherryPopupsFrontScripts.init();
}(jQuery, window.CherryJsCore));
!function(a){a.fn.hoverIntent=function(e,t,n){var o,r,v,i,u={interval:100,sensitivity:6,timeout:0};u="object"==typeof e?a.extend(u,e):a.isFunction(t)?a.extend(u,{over:e,out:t,selector:n}):a.extend(u,{over:e,out:e,selector:t});function s(e){o=e.pageX,r=e.pageY}function h(e){var t=a.extend({},e),n=this;n.hoverIntent_t&&(n.hoverIntent_t=clearTimeout(n.hoverIntent_t)),"mouseenter"===e.type?(v=t.pageX,i=t.pageY,a(n).on("mousemove.hoverIntent",s),n.hoverIntent_s||(n.hoverIntent_t=setTimeout(function(){I(t,n)},u.interval))):(a(n).off("mousemove.hoverIntent",s),n.hoverIntent_s&&(n.hoverIntent_t=setTimeout(function(){!function(e,t){t.hoverIntent_t=clearTimeout(t.hoverIntent_t),t.hoverIntent_s=!1,u.out.apply(t,[e])}(t,n)},u.timeout)))}var I=function(e,t){if(t.hoverIntent_t=clearTimeout(t.hoverIntent_t),Math.sqrt((v-o)*(v-o)+(i-r)*(i-r))
'+t.text+""),n(i).hide().on("click.UItoTop",function(){return n("html, body").animate({scrollTop:0},t.scrollSpeed,t.easingType),n("#"+t.containerHoverID,this).stop().animate({opacity:0},t.inDelay,t.easingType),!1}).hover(function(){n(a,this).stop().animate({opacity:1},600,"linear")},function(){n(a,this).stop().animate({opacity:0},700,"linear")}),n(window).scroll(function(){var o=n(window).scrollTop();"undefined"==typeof document.body.style.maxHeight&&n(i).css({position:"absolute",top:o+n(window).height()-50}),o>t.min?n(i).fadeIn(t.inDelay):n(i).fadeOut(t.Outdelay)})}}(jQuery);
!function(t){t.fn.stickUp=function(e){function o(){a=parseInt(n.offset().top),d=parseInt(n.css("margin-top")),u=parseInt(n.outerHeight(!0)),c.pseudo&&(t('').insertAfter(n),i=t(".pseudoStickyBlock"),i.css({position:"relative",display:"block"})),c.active&&s(),n.addClass("stuckMenu")}function s(){p.on("scroll.stickUp",function(){r=t(this).scrollTop(),S=r>k?"down":"up",k=r,0!=h.length?correctionValue=h.outerHeight(!0):correctionValue=0,f=parseInt(l.scrollTop()),a+u-correctionValue%3$s%4$s',child_wrap:"",child:'%3$s'};n.prototype.set=function(e){if(!1==e instanceof n)throw new Error("Invalid argument type");return this.children[e.id]=e,this},n.prototype.push=function(e){return this.set(e)},n.prototype.get=function(e){var t=null;return this.map(e,function(e,n){return t=n,n}),t},n.prototype.map=function(e,t,n){var i={id:e},r=this;return"string"!=typeof e&&(i=e),n=n||this.children,0>=n.length?i:(Object.keys(n).forEach(function(e){child=n[e],i.id===child.id?n[i.id]=t(child):child.children&&0